
package editeur;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JPanel;

public class PanneauImage extends JPanel{
	private Fenetre conteneur;

	public Fenetre getConteneur() {
		return conteneur;
	}

	public PanneauImage(Fenetre f){
		this.setBackground(Color.white);
		conteneur = f;
		
	}
	
	@Override
	protected void paintComponent (Graphics g){
		g = (Graphics2D)g;
		//System.out.println("=== "+getConteneur());
		Vector<Photo> tabP=getConteneur().getAlbCourant().getAlbum();
		getConteneur().getAlbCourant().afficheAlbum();
		System.out.println("paintcomponent ");
		if(!tabP.isEmpty()){
			super.paintComponents(g);
			int ind=conteneur.getAlbCourant().getIndice()-1;
			tabP.elementAt(ind).dessine((Graphics2D)g);
			System.out.println("dessine ");
		}
	}

}

